package com.example.administrator.appjiamzhi;

/**
 * Created by Administrator on 2016/12/28.
 */

import android.os.Bundle;


        import android.content.Intent;
        import android.os.Bundle;
        import android.util.Log;
        import android.view.View;
        import android.widget.Button;
        import android.widget.CheckBox;
        import android.widget.EditText;
        import android.widget.Toast;

/**
 * Created by Administrator on 2016/12/15 0015.
 */

public class denglu extends zhuye {
    private EditText zEditText;
    private EditText mEditText;
    private Button delu_Button;
    private CheckBox jizhu_CheckBox;
    private CheckBox zidong_CheckBox;
    private Button wangji_Botton;
    private Button zhuce_Botton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.denglu);

        initView();
    }
    public  void initView() {
        zEditText = (EditText) findViewById(R.id.shuruzhanghao);
        mEditText = (EditText) findViewById(R.id.shurumima);
        delu_Button = (Button)findViewById(R.id.denglu);
        jizhu_CheckBox = (CheckBox)findViewById(R.id.jizhumima);
        zidong_CheckBox = (CheckBox)findViewById(R.id.zidongdenglu);
        wangji_Botton = (Button)findViewById(R.id.wangjimima);
        zhuce_Botton = (Button)findViewById(R.id.woyaozhuce);
        delu_Button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //获取账号和密码
                String zhanghaoText = zEditText.getText().toString();
                String mimaText = mEditText.getText().toString();
                //如果满足跳转界面，否则提示错误
                if (zEditText.equals("lenncun") && mimaText.equals("123hg")) {
                    Intent intent = new Intent(denglu.this,zhuye.class);
                    startActivity(intent);
                }else {
                    // Log.d("登录失败","账号或密码错误");
                    Toast.makeText(denglu.this,"您的账号或密码有误",Toast.LENGTH_LONG).show();
                }

            }
        });
        zhuce_Botton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(denglu.this,zhuce.class);
                startActivity(intent);
            }
        });
        wangji_Botton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(denglu.this,zhaohuimima.class);
                startActivity(intent);
            }
        });
    }



}

